           package com.java.diagnostics.visualizer.parser.vgc.constants;
           
           public abstract class Enumerator
           {
             protected static final String UNKNOWN = "unknown";
             private int lastIndex;
           
             protected abstract String[] getStrings();
           
             public int internalNameToInt(String name)
             {
               int number = -1;
           
               int index = this.lastIndex;
               String[] strings = getStrings();
               do {
                 if (strings[index].equals(name))
                 {
                   this.lastIndex = (number = index);
                   break;
                 }
                 index = (index + 1) % strings.length;
               }while (index != this.lastIndex);
           
               return number;
             }
           
             public String internalIntToName(int number)
             {
               String[] strings = getStrings();
               if ((number < 0) || (number > strings.length - 1))
               {
                 return "unknown";
               }
           
               return strings[number];
             }
           }

